/************************************************************************
                                                                     
   Xceed Ultimate ListBox for Silverlight                                                                                                                                            
   Copyright (C) 2010 Xceed Software Inc.    
                                                                     
   This program is provided to you under the terms of the GNU General Public  
   License version 2 as published by the Free Software Foundation. 
        
   This program is distributed in the hope that it will be useful, but
   WITHOUT ANY WARRANTY, without even the implied warranty of 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License along 
   with this program, if not, write to the Free Software Foundation, Inc., 
   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

   This program can be provided to you by Xceed Software Inc. under a
   proprietary commercial license agreement for use in non-Open Source
   projects. Visit Xceed.com to find the commercial edition of 
   Xceed Ultimate ListBox for Silverlight.                                    
                                                                      
 **********************************************************************/

using System.Diagnostics;

namespace Xceed.Silverlight.Data
{
  internal struct JumpMoveAndFetchParameters
  {
    internal JumpMoveAndFetchParameters(
      SourcePosition sourcePosition,
      long expectedMoveCount,
      int expectedFetchCount )
      : this( sourcePosition, expectedMoveCount, expectedFetchCount, false )
    {
    }

    internal JumpMoveAndFetchParameters(
      SourcePosition sourcePosition,
      long expectedMoveCount,
      int expectedFetchCount,
      bool approximateMove )
    {
      m_sourcePosition = sourcePosition;
      m_expectedMoveCount = expectedMoveCount;
      m_expectedFetchCount = expectedFetchCount;
      m_approximateMove = approximateMove;
    }


    #region SourcePosition Property

    internal SourcePosition SourcePosition
    {
      get
      {
        return m_sourcePosition;
      }
    }

    #endregion SourcePosition Property

    #region ExpectedMoveCount Property

    internal long ExpectedMoveCount
    {
      get
      {
        return m_expectedMoveCount;
      }
    }

    #endregion ExpectedMoveCount Property

    #region ExpectedFetchCount Property

    internal int ExpectedFetchCount
    {
      get
      {
        return m_expectedFetchCount;
      }
    }

    #endregion ExpectedFetchCount Property

    #region ApproximateMove Property

    internal bool ApproximateMove
    {
      get
      {
        return m_approximateMove;
      }
    }

    #endregion ApproximateMove Property


    internal JumpMoveAndFetchParameters CreateWithNewSourcePosition( SourcePosition sourcePosition )
    {
      return new JumpMoveAndFetchParameters( sourcePosition, m_expectedMoveCount, m_expectedFetchCount, m_approximateMove );
    }

    internal JumpMoveAndFetchParameters CreateWithNewMoveCount( long expectedMoveCount )
    {
      return new JumpMoveAndFetchParameters( m_sourcePosition, expectedMoveCount, m_expectedFetchCount, m_approximateMove );
    }

    internal JumpMoveAndFetchParameters CreateWithNewFetchCount( int expectedFetchCount )
    {
      return new JumpMoveAndFetchParameters( m_sourcePosition, m_expectedMoveCount, expectedFetchCount, m_approximateMove );
    }

    internal JumpMoveAndFetchParameters CreateWithNewApproximateMoving( bool approximateMove )
    {
      return new JumpMoveAndFetchParameters( m_sourcePosition, m_expectedMoveCount, m_expectedFetchCount, approximateMove );
    }

#if DEBUG
    public override string ToString()
    {
      return string.Format( "ExpMove={0}, ExpFetch={1}, SourcePos={2}", this.ExpectedMoveCount, this.ExpectedFetchCount, this.SourcePosition );
    }
#endif


    #region Private Fields

    private SourcePosition m_sourcePosition;
    private long m_expectedMoveCount;
    private int m_expectedFetchCount;
    private bool m_approximateMove;

    #endregion Private Fields
  }
}
